Skip to content

fix(toolkit-lib): warn on empty change sets for unsuccessful stacks - #2029

Open
proton0210 wants to merge 5 commits into
aws:mainfrom
proton0210:fix/no-change-failed-stack-warning
Open

proton0210 wants to merge 5 commits into
aws:mainfrom
proton0210:fix/no-change-failed-stack-warning

Conversation

@proton0210

@proton0210 proton0210 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Warn with the stack name and status when an empty change set leaves an existing deployed stack outside a successful deployment state.
  • Exclude missing stacks and unexecuted CREATE change sets from that warning.
  • For a stable rolled-back stack, explain that the previous deployment rolled back and suggest reviewing events, without claiming the stable status needs resolution.
  • Suppress the misleading force-deployment claim that all resources are up to date for unsuccessful existing stacks.
  • Preserve the no-op result, exit-code behavior, and change-set cleanup. This implements the warning-only first step suggested in cdk deploy reports "(no changes)" and exits 0 while the stack is still in UPDATE_FAILED #1972; it does not change failure exit codes or recovery behavior.

Related to #1972.

Validation

  • Merged current upstream main (f7c9dca); Git resolved the merge cleanly.
  • Full monorepo compilation passes (yarn compile).
  • Deployment-stack suite: 135 tests and 1 snapshot pass, including missing stacks, REVIEW_IN_PROGRESS, failed updates, successful deployments, and UPDATE_ROLLBACK_COMPLETE / IMPORT_ROLLBACK_COMPLETE with force and no-execute coverage.
  • ESLint passes for the changed source and test files; git diff --check passes.
  • No live AWS deployment was performed; tests use the existing fake CloudFormation implementation. Hosted CI must validate the new head; integration execution requires maintainer approval.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@codecov-commenter

codecov-commenter commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.52%. Comparing base (f7c9dca) to head (2851643).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2029      +/-   ##
==========================================
- Coverage   92.55%   92.52%   -0.04%     
==========================================
  Files          81       81              
  Lines       13224    13224              
  Branches     1917     1915       -2     
==========================================
- Hits        12240    12236       -4     
- Misses        946      950       +4     
  Partials       38       38              
Flag Coverage Δ
suite.unit 92.52% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@proton0210
proton0210 marked this pull request as draft October 21, 2026 06:07
auto-merge was automatically disabled October 21, 2026 06:07

Pull request was converted to draft

@proton0210
proton0210 marked this pull request as ready for review October 21, 2026 06:09
@maintainer-for-aws

maintainer-for-aws Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Automated review

A maintainer will still review this — treat the notes below as a starting point.

📌 Commit 2851643

This PR changes how cdk deploy in toolkit-lib handles an empty change set for a stack that already exists but isn't in a successful state, such as UPDATE_FAILED. Before, the command quietly reported "(no changes)". Now FullCloudFormationDeployment.changeSetDeployment warns with the stack name and its status. A stack that has rolled back cleanly gets its own wording, and the --force "already up-to-date" message no longer appears for unsuccessful stacks. The no-op result, exit codes and change-set cleanup stay the same.

The warning is gated on this.update, so it doesn't fire for new stacks or for REVIEW_IN_PROGRESS stacks. Rolled-back states are told the previous deployment rolled back, not asked to resolve the stack status. The new tests cover both sides of each branch, including how many times the change set is deleted with and without execute. The change has no open issues.

Resolved since an earlier review (2)
  • 🟡 Recommended · Thread #4333617086 · packages/@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack.ts
  • ⚪ Optional · Thread #4333617098 · packages/@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack.ts

Open findings: 🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional.


Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews.

@maintainer-for-aws maintainer-for-aws Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review summary comment for the overview; the notes below are inline.

@mrgrain

mrgrain commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Thank you for this contribution. Please address the review feedback and resolve conflicts, otherwise this PR will be closed

This branch is waiting to be deployed

1 inactive (outdated) and 1 waiting deployments
integ-approval — 28516431 Waiting Nov 28, 2026 by proton0210 via prepare #7814
automation — 4ec6593c Deployed Oct 8, 2026 by proton0210 via Triage Pull Requests #2180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants